package com.fhz.mvvm.dao

import androidx.lifecycle.LiveData
import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import com.fhz.mvvm.entity.User

/**
 * 时间:2023/3/28
 * @author Mr.Feng
 * 简述: TODO
 */
@Dao
interface UserDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insertUser(user:User):Long

    @Query("select * from user where username = :name" )
    fun findUserByName(name:String) : LiveData<User>
}